package com.ibuonline.b2b.entity;

import java.io.Serializable;

public class Attribute implements Serializable {

	private static final long serialVersionUID = -5960791686135126899L;

	//fields
	private java.lang.Integer id;
	private java.lang.String label;

	//default constructor
	public Attribute() {
	}

	//getter
	public java.lang.Integer getId() {
		return id;
	}
	public java.lang.String getLabel() {
		return label;
	}

	//setter
	public void setId(java.lang.Integer id) {
		this.id = id;
	}
	public void setLabel(java.lang.String label) {
		this.label = label;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof Attribute))
			return false;

		final Attribute attribute = (Attribute)other;
		if (!this.id.equals(attribute.getId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(id).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("Attribute[")
			.append("id=").append(id).append(", ")
			.append("label=").append(label).append("]").toString();
	}
	
	///##########################
	public Attribute(Integer id, String label) {
		this.id = id;
		this.label = label;
	}
	
	public Attribute(Integer id, String label, String value) {
		this(id, label);
		this.value = value;
	}
	
	private String value;

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
}